import axios from 'axios';
// 为角色配置菜单
let menu = (data) => axios.post('/role/menu', data);
// 添加角色
let add = (data) => axios.post('/role', data);
// 配置角色--路由权限
let edit_route = (data) => axios.post('/role/route', data);
// 根据角色id，获取路由权限
let route = (params) => axios.get('/role/route/', { params });
// 根据角色获取侧边栏菜单+按钮
let get_menu = (params) => axios.get('/role/menu/', { params });
//获取角色列表
let list = (params) => axios.get('/role/list', { params });
// 更新角色
let edit = (id,data) => axios.put(`/role/${id}`, data);
// 删除角色
let remove = (id,params) => axios.delete(`/role/${id}`, {params});
export default {
	list,
    add,
    edit,
    remove,
    menu,
    edit_route,
    route,
    get_menu
}
